.class public Lcom/kuguo/ad/g;
.super Ljava/lang/Object;


# static fields
.field static a:Ljava/lang/Object;


# instance fields
.field private b:Landroid/content/Context;

.field private c:Lcom/kuguo/ad/ap;

.field private d:I

.field private e:Lcom/kuguo/ad/z;

.field private f:Lcom/kuguo/ad/x;

.field private g:I

.field private h:Landroid/os/Handler;

.field private i:Lcom/kuguo/ui/c;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    sput-object v0, Lcom/kuguo/ad/g;->a:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    const/4 v1, 0x4

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput v1, p0, Lcom/kuguo/ad/g;->g:I

    new-instance v0, Lcom/kuguo/ad/w;

    invoke-direct {v0, p0}, Lcom/kuguo/ad/w;-><init>(Lcom/kuguo/ad/g;)V

    iput-object v0, p0, Lcom/kuguo/ad/g;->h:Landroid/os/Handler;

    iput v1, p0, Lcom/kuguo/ad/g;->d:I

    new-instance v0, Lcom/kuguo/ad/ap;

    invoke-direct {v0, p1}, Lcom/kuguo/ad/ap;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iput-object p1, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {p1}, Lcom/kuguo/a/f;->a(Landroid/content/Context;)Lcom/kuguo/a/f;

    return-void
.end method

.method static synthetic a(Lcom/kuguo/ad/g;)Lcom/kuguo/ad/ap;
    .locals 1

    iget-object v0, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    return-object v0
.end method

.method private a([Lcom/kuguo/ad/o;)V
    .locals 8

    const/4 v7, 0x0

    array-length v0, p1

    move v1, v7

    :goto_0
    if-ge v1, v0, :cond_1

    aget-object v2, p1, v1

    iget v2, v2, Lcom/kuguo/ad/o;->h:I

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "download/ads/"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    new-instance v3, Ljava/io/File;

    invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File;

    move-result-object v4

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v5, "/icon.png"

    invoke-virtual {v2, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v3, v4, v2}, Ljava/io/File;-><init>(Ljava/io/File;Ljava/lang/String;)V

    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v2

    if-nez v2, :cond_0

    new-instance v2, Lcom/kuguo/a/d;

    aget-object v3, p1, v1

    iget-object v3, v3, Lcom/kuguo/ad/o;->q:Ljava/lang/String;

    iget-object v4, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    const-string v5, "icon.png"

    aget-object v6, p1, v1

    iget v6, v6, Lcom/kuguo/ad/o;->h:I

    invoke-static {v4, v5, v6}, Lcom/kuguo/ad/a;->b(Landroid/content/Context;Ljava/lang/String;I)Ljava/io/File;

    move-result-object v4

    invoke-direct {v2, v3, v4, v7}, Lcom/kuguo/a/d;-><init>(Ljava/lang/String;Ljava/io/File;I)V

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/kuguo/a/d;->a(Ljava/lang/Object;)V

    new-instance v3, Lcom/kuguo/ad/x;

    iget-object v4, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    aget-object v5, p1, v1

    iget-object v6, p0, Lcom/kuguo/ad/g;->h:Landroid/os/Handler;

    invoke-direct {v3, v4, v5, v6}, Lcom/kuguo/ad/x;-><init>(Landroid/content/Context;Lcom/kuguo/ad/o;Landroid/os/Handler;)V

    iput-object v3, p0, Lcom/kuguo/ad/g;->f:Lcom/kuguo/ad/x;

    iget-object v3, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    iget-object v4, p0, Lcom/kuguo/ad/g;->f:Lcom/kuguo/ad/x;

    invoke-static {v3, v2, v4}, Lcom/kuguo/ad/r;->a(Landroid/content/Context;Lcom/kuguo/a/d;Lcom/kuguo/a/c;)V

    :cond_0
    const-wide/16 v2, 0x32

    :try_start_0
    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :catch_0
    move-exception v2

    goto :goto_1

    :cond_1
    return-void
.end method

.method static synthetic b(Lcom/kuguo/ad/g;)Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    return-object v0
.end method

.method private b()V
    .locals 6

    const/4 v0, 0x0

    move v1, v0

    :goto_0
    if-nez v1, :cond_1

    iget v2, p0, Lcom/kuguo/ad/g;->g:I

    if-ge v0, v2, :cond_1

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v2

    const-string v3, "mounted"

    invoke-virtual {v3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_0

    invoke-direct {p0}, Lcom/kuguo/ad/g;->c()Z

    move-result v1

    :goto_1
    add-int/lit8 v0, v0, 0x1

    const-wide/16 v2, 0x7d0

    :try_start_0
    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v2

    invoke-virtual {v2}, Ljava/lang/InterruptedException;->printStackTrace()V

    goto :goto_0

    :cond_0
    const-string v3, "android__log"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "externalStorageState = "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v3, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1

    :cond_1
    return-void
.end method

.method static synthetic c(Lcom/kuguo/ad/g;)I
    .locals 1

    iget v0, p0, Lcom/kuguo/ad/g;->d:I

    return v0
.end method

.method private c()Z
    .locals 8

    const/4 v6, 0x0

    new-instance v0, Lorg/apache/http/client/methods/HttpPost;

    const-string v1, "http://www.cooguo.com/cooguogw/list.action"

    invoke-direct {v0, v1}, Lorg/apache/http/client/methods/HttpPost;-><init>(Ljava/lang/String;)V

    invoke-direct {p0}, Lcom/kuguo/ad/g;->d()V

    iget-object v1, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    invoke-virtual {v1}, Lcom/kuguo/ad/ap;->a()V

    :try_start_0
    new-instance v1, Lorg/apache/http/entity/ByteArrayEntity;

    iget-object v2, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    invoke-virtual {v2}, Lcom/kuguo/ad/ap;->b()[B

    move-result-object v2

    invoke-direct {v1, v2}, Lorg/apache/http/entity/ByteArrayEntity;-><init>([B)V

    invoke-virtual {v0, v1}, Lorg/apache/http/client/methods/HttpPost;->setEntity(Lorg/apache/http/HttpEntity;)V

    const-string v1, "android__log"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "post url is "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Lorg/apache/http/client/methods/HttpPost;->getURI()Ljava/net/URI;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/kuguo/c/a;->a(Ljava/lang/String;Ljava/lang/Object;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_6

    :goto_0
    :try_start_1
    iget-object v1, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v1}, Lcom/kuguo/ad/r;->a(Landroid/content/Context;)Lorg/apache/http/client/HttpClient;

    move-result-object v1

    if-nez v1, :cond_0

    move v0, v6

    :goto_1
    return v0

    :cond_0
    invoke-interface {v1, v0}, Lorg/apache/http/client/HttpClient;->execute(Lorg/apache/http/client/methods/HttpUriRequest;)Lorg/apache/http/HttpResponse;

    move-result-object v1

    invoke-interface {v1}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v2

    invoke-interface {v2}, Lorg/apache/http/StatusLine;->getStatusCode()I

    move-result v2

    const-string v3, "android__log"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "b -----------status: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_1
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_1 .. :try_end_1} :catch_5
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    const/16 v3, 0xc8

    if-ne v2, v3, :cond_1

    const/4 v0, 0x1

    :try_start_2
    iget-object v2, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iget-object v2, v2, Lcom/kuguo/ad/ap;->n:Ljava/lang/String;

    invoke-static {v2}, Lcom/kuguo/ad/a;->d(Ljava/lang/String;)Z

    invoke-interface {v1}, Lorg/apache/http/HttpResponse;->getEntity()Lorg/apache/http/HttpEntity;

    move-result-object v1

    invoke-interface {v1}, Lorg/apache/http/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/kuguo/ad/g;->a(Ljava/io/InputStream;)V
    :try_end_2
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_2 .. :try_end_2} :catch_0
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_4
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_3

    goto :goto_1

    :catch_0
    move-exception v1

    move-object v7, v1

    move v1, v0

    move-object v0, v7

    :goto_2
    invoke-virtual {v0}, Lorg/apache/http/client/ClientProtocolException;->printStackTrace()V

    move v0, v1

    goto :goto_1

    :cond_1
    :try_start_3
    invoke-virtual {v0}, Lorg/apache/http/client/methods/HttpPost;->abort()V
    :try_end_3
    .catch Lorg/apache/http/client/ClientProtocolException; {:try_start_3 .. :try_end_3} :catch_5
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_1
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2

    move v0, v6

    goto :goto_1

    :catch_1
    move-exception v0

    move v1, v6

    :goto_3
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    move v0, v1

    goto :goto_1

    :catch_2
    move-exception v0

    move v0, v6

    goto :goto_1

    :catch_3
    move-exception v1

    goto :goto_1

    :catch_4
    move-exception v1

    move-object v7, v1

    move v1, v0

    move-object v0, v7

    goto :goto_3

    :catch_5
    move-exception v0

    move v1, v6

    goto :goto_2

    :catch_6
    move-exception v1

    goto :goto_0
.end method

.method private d()V
    .locals 5

    iget-object v0, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v0}, Lcom/kuguo/ad/a;->k(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v1, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iput-object v0, v1, Lcom/kuguo/ad/ap;->n:Ljava/lang/String;

    :cond_0
    iget-object v0, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iget-object v1, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v1}, Lcom/kuguo/ad/r;->d(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Lcom/kuguo/ad/ap;->l:Ljava/lang/String;

    iget-object v0, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iget-object v0, v0, Lcom/kuguo/ad/ap;->n:Ljava/lang/String;

    invoke-static {v0}, Lcom/kuguo/ad/a;->e(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_1

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "-13,"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v2}, Lcom/kuguo/ad/a;->s(Landroid/content/Context;)I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ";"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :cond_1
    const-string v1, "android__log"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "first request statu is ------------ "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/kuguo/c/a;->a(Ljava/lang/String;Ljava/lang/Object;)V

    iget-object v1, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iput-object v0, v1, Lcom/kuguo/ad/ap;->j:Ljava/lang/String;

    iget-object v0, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v0}, Lcom/kuguo/ad/a;->q(Landroid/content/Context;)Landroid/location/Location;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "location : "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/kuguo/ad/a;->a(Ljava/lang/String;)V

    if-eqz v0, :cond_2

    iget-object v1, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    invoke-virtual {v0}, Landroid/location/Location;->getLongitude()D

    move-result-wide v2

    iput-wide v2, v1, Lcom/kuguo/ad/ap;->f:D

    iget-object v1, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    invoke-virtual {v0}, Landroid/location/Location;->getLatitude()D

    move-result-wide v2

    iput-wide v2, v1, Lcom/kuguo/ad/ap;->e:D

    invoke-virtual {v0}, Landroid/location/Location;->getLongitude()D

    move-result-wide v1

    invoke-virtual {v0}, Landroid/location/Location;->getLatitude()D

    move-result-wide v3

    invoke-static {v1, v2, v3, v4}, Lcom/kuguo/ad/a;->a(DD)Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/kuguo/ad/g;->c:Lcom/kuguo/ad/ap;

    iput-object v0, v1, Lcom/kuguo/ad/ap;->s:Ljava/lang/String;

    :cond_2
    return-void
.end method

.method static synthetic d(Lcom/kuguo/ad/g;)V
    .locals 0

    invoke-direct {p0}, Lcom/kuguo/ad/g;->b()V

    return-void
.end method

.method static synthetic e(Lcom/kuguo/ad/g;)Lcom/kuguo/ui/c;
    .locals 1

    iget-object v0, p0, Lcom/kuguo/ad/g;->i:Lcom/kuguo/ui/c;

    return-object v0
.end method


# virtual methods
.method public a()V
    .locals 1

    new-instance v0, Lcom/kuguo/ad/u;

    invoke-direct {v0, p0}, Lcom/kuguo/ad/u;-><init>(Lcom/kuguo/ad/g;)V

    invoke-virtual {v0}, Lcom/kuguo/ad/u;->start()V

    return-void
.end method

.method public a(Lcom/kuguo/ad/z;)V
    .locals 0

    iput-object p1, p0, Lcom/kuguo/ad/g;->e:Lcom/kuguo/ad/z;

    return-void
.end method

.method public a(Lcom/kuguo/ui/c;)V
    .locals 0

    iput-object p1, p0, Lcom/kuguo/ad/g;->i:Lcom/kuguo/ui/c;

    return-void
.end method

.method protected a(Ljava/io/InputStream;)V
    .locals 8

    const/4 v2, 0x0

    const/4 v6, 0x1

    :try_start_0
    new-instance v0, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v0}, Ljava/io/ByteArrayOutputStream;-><init>()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    :try_start_1
    new-instance v1, Ljava/io/DataInputStream;

    invoke-direct {v1, p1}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_2
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2

    const/16 v2, 0x200

    :try_start_2
    new-array v2, v2, [B

    :goto_0
    invoke-virtual {v1, v2}, Ljava/io/DataInputStream;->read([B)I

    move-result v3

    const/4 v4, -0x1

    if-eq v3, v4, :cond_2

    const/4 v4, 0x0

    invoke-virtual {v0, v2, v4, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->flush()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_3
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    :catch_0
    move-exception v2

    move-object v7, v2

    move-object v2, v1

    move-object v1, v0

    move-object v0, v7

    :goto_1
    :try_start_3
    new-instance v3, Ljava/lang/Exception;

    invoke-direct {v3, v0}, Ljava/lang/Exception;-><init>(Ljava/lang/Throwable;)V

    throw v3
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :catchall_0
    move-exception v0

    :goto_2
    if-eqz v1, :cond_0

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_0
    if-eqz v2, :cond_1

    invoke-virtual {v2}, Ljava/io/DataInputStream;->close()V

    :cond_1
    throw v0

    :cond_2
    :try_start_4
    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v2

    if-eqz v2, :cond_3

    array-length v3, v2
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_3
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0

    if-nez v3, :cond_6

    :cond_3
    if-eqz v0, :cond_4

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_4
    if-eqz v1, :cond_5

    invoke-virtual {v1}, Ljava/io/DataInputStream;->close()V

    :cond_5
    :goto_3
    return-void

    :cond_6
    :try_start_5
    invoke-static {v2}, Lcom/kuguo/ad/o;->a([B)[Lcom/kuguo/ad/o;

    move-result-object v2

    if-nez v2, :cond_9

    iget-object v3, p0, Lcom/kuguo/ad/g;->e:Lcom/kuguo/ad/z;

    if-eqz v3, :cond_7

    iget-object v3, p0, Lcom/kuguo/ad/g;->e:Lcom/kuguo/ad/z;

    invoke-interface {v3, v2}, Lcom/kuguo/ad/z;->a([Lcom/kuguo/ad/o;)V

    :cond_7
    invoke-static {}, Lcom/kuguo/ad/KuguoAdsManager;->getInstance()Lcom/kuguo/ad/KuguoAdsManager;

    move-result-object v2

    iget-object v3, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Lcom/kuguo/ad/KuguoAdsManager;->removeKuguoSprite(Landroid/content/Context;I)V

    invoke-static {}, Lcom/kuguo/ad/KuguoAdsManager;->getInstance()Lcom/kuguo/ad/KuguoAdsManager;

    move-result-object v2

    iget-object v3, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    const/4 v4, 0x1

    invoke-virtual {v2, v3, v4}, Lcom/kuguo/ad/KuguoAdsManager;->removeKuguoSprite(Landroid/content/Context;I)V

    iget-object v2, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    const/4 v3, 0x0

    invoke-static {v2, v3}, Lcom/kuguo/ad/a;->a(Landroid/content/Context;Z)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_3
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_0

    if-eqz v0, :cond_8

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_8
    if-eqz v1, :cond_5

    invoke-virtual {v1}, Ljava/io/DataInputStream;->close()V

    goto :goto_3

    :cond_9
    :try_start_6
    iget-object v3, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    const/4 v4, 0x1

    invoke-static {v3, v4}, Lcom/kuguo/ad/a;->a(Landroid/content/Context;Z)V

    invoke-static {}, Lcom/kuguo/ad/KuguoAdsManager;->getInstance()Lcom/kuguo/ad/KuguoAdsManager;

    move-result-object v3

    iget-object v4, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-virtual {v3, v4}, Lcom/kuguo/ad/KuguoAdsManager;->showSprite(Landroid/content/Context;)V

    iget-object v3, p0, Lcom/kuguo/ad/g;->e:Lcom/kuguo/ad/z;

    if-eqz v3, :cond_a

    iget-object v3, p0, Lcom/kuguo/ad/g;->e:Lcom/kuguo/ad/z;

    invoke-interface {v3, v2}, Lcom/kuguo/ad/z;->a([Lcom/kuguo/ad/o;)V

    :cond_a
    const-string v3, "android__log"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "msgs size is "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    array-length v5, v2

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/kuguo/c/a;->a(Ljava/lang/String;Ljava/lang/Object;)V

    iget-object v3, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v3, v2}, Lcom/kuguo/ad/a;->a(Landroid/content/Context;[Lcom/kuguo/ad/o;)Z

    array-length v3, v2

    if-le v3, v6, :cond_b

    const-string v3, "android__log"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "msg[0].liststyle------------- "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const/4 v5, 0x0

    aget-object v5, v2, v5

    iget v5, v5, Lcom/kuguo/ad/o;->J:I

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Lcom/kuguo/c/a;->a(Ljava/lang/String;Ljava/lang/Object;)V

    iget-object v3, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    const/4 v4, 0x0

    aget-object v4, v2, v4

    iget v4, v4, Lcom/kuguo/ad/o;->J:I

    invoke-static {v3, v4}, Lcom/kuguo/ad/a;->b(Landroid/content/Context;I)V

    :cond_b
    invoke-direct {p0, v2}, Lcom/kuguo/ad/g;->a([Lcom/kuguo/ad/o;)V

    iget-object v2, p0, Lcom/kuguo/ad/g;->b:Landroid/content/Context;

    invoke-static {v2}, Lcom/kuguo/ad/a;->p(Landroid/content/Context;)Z
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_3
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_0

    if-eqz v0, :cond_c

    invoke-virtual {v0}, Ljava/io/ByteArrayOutputStream;->close()V

    :cond_c
    if-eqz v1, :cond_5

    invoke-virtual {v1}, Ljava/io/DataInputStream;->close()V

    goto/16 :goto_3

    :catchall_1
    move-exception v0

    move-object v1, v2

    goto/16 :goto_2

    :catchall_2
    move-exception v1

    move-object v7, v1

    move-object v1, v0

    move-object v0, v7

    goto/16 :goto_2

    :catchall_3
    move-exception v2

    move-object v7, v2

    move-object v2, v1

    move-object v1, v0

    move-object v0, v7

    goto/16 :goto_2

    :catch_1
    move-exception v0

    move-object v1, v2

    goto/16 :goto_1

    :catch_2
    move-exception v1

    move-object v7, v1

    move-object v1, v0

    move-object v0, v7

    goto/16 :goto_1
.end method
